package com.example.demo.mapper;

import com.example.demo.entity.Root;
import com.example.demo.entity.Student;
import com.example.demo.entity.Teacher;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RootMapper {

    @Select("select * from admin")
    List<Root> select();

    @Select("select id,user_name,password from admin where user_name=#{userName} and password=#{password}")
    Root selectByUserName(String userName, String password);

    @Delete("delete from admin where id=#{id}")
    Integer delById(Integer id);

    @Insert("insert into admin(name,user_name,password)" +
            " values(#{name},#{userName},#{password})")
    Integer insertAdm(Root root);
}
